﻿using Model;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DAL
{
    public class VendorDAL : PageDAL<VendorModel>
    {
        public VendorModel GetModelByID(string tableName, int pid)
        {
            string sql = $"select * from  {tableName} where id='{pid}'";
            DataTable dt = new DBHelper().GetDataTable(sql);
            VendorModel model = new VendorModel()
            {
                ID = int.Parse(dt.Rows[0]["id"].ToString()),
                Name = dt.Rows[0]["Name"].ToString(),
                 Address = dt.Rows[0]["Address"].ToString(),
                    Call = dt.Rows[0]["Call"].ToString(),
                AB = dt.Rows[0]["Ab"].ToString(),
           Remark = dt.Rows[0]["Remark"].ToString(),

            };
            return model;
        }

       
    }
}
